package com.hkd.common.api.enums;

/**
 * @author HKD
 * @date 2022/9/17 20:14
 */
public enum Sex {
    MALE(0),
    WOMEN(1)
    ;


    private Integer code;

    Sex(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    public static Sex search(Integer code){
        Sex[] values = values();
        for (Sex value : values) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}

